<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-cache">
		<meta http-equiv="Expires" content="0">
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-cache">
		
		<style>
			[v-cloak] {
				display: none;
			}
			
		</style>
	</head>

	<body>
		<div id="app" v-cloak>
		<div @click="hotel">点击跳转</div>
			
		</div>
		
		<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
		     
		      
		      
		<script>
			
			var app = new Vue({
				el: '#app',
				data: {
					
				},
				created: function() {
					
				},
				methods: {
					
					
					hotel: function(HotelId,ArrivalDate,DepartureDate,cityID,cityName) {//jingqu
						
						var url = 'hotel?{HotelId:' + HotelId + ',ArrivalDate:' + ArrivalDate + ',DepartureDate:' + DepartureDate + ',cityID:' + cityID + ',cityName:' + cityName + '}';
						var param = {
							View: 'hotel',
							HotelId: HotelId,
							ArrivalDate: ArrivalDate,
							DepartureDate:DepartureDate,
							cityID:cityID,
							cityName:cityName
						};
						var ua = navigator.userAgent.toLowerCase();
						    if(ua.match(/MicroMessenger/i)=="micromessenger") {
						        //ios的ua中无miniProgram，但都有MicroMessenger（表示是微信浏览器）
						        wx.miniProgram.getEnv((res)=>{
						           if (res.miniprogram) {
						               const url = '/page/hotel/pages/hoteldetail/hoteldetail?id='+param.HotelId + '&citycode=' + param.cityID + '&hotellidiandate=' + param.ArrivalDate + '&hotelzhudiandate=' + param.DepartureDate;
						               //跳转到小程序支付界面wxPay
						               wx.miniProgram.navigateTo({
						               	url: url
						               });
						           } else {
						               
						           }
						        })
								// this.skip(url, param);
						    }else{
								this.skip(url, param);
						        // alert('不在微信里');
						    }
						// console.log(param)
						// wx.miniProgram.getEnv((res) =>{
						// 	if (res.miniprogram) {
						// 		const url = '/page/hotel/pages/hoteldetail/hoteldetail?id='+param.HotelId + '&citycode=' + param.cityID + '&hotellidiandate=' + param.ArrivalDate + '&hotelzhudiandate=' + param.DepartureDate;
						// 		//跳转到小程序支付界面wxPay
						// 		wx.miniProgram.navigateTo({
						// 			url: url
						// 		});
						// 	} else{
						// 		// console.log(123)
						// 		this.skip(url, param);
								
						// 	}
						// })
						// console.log(url,param);return
						
					},
					
				},
				
			})
		</script>
	</body>

</html>
